package cn.cqows;

import cn.cqows.pojo.FaultQue;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.UrlResource;
import org.springframework.util.ResourceUtils;

import java.io.*;
import java.net.MalformedURLException;

public class Demo {
    public static void main(String[] args) throws IOException {
//        ClassPathResource classPathResource = new ClassPathResource("a.txt");
        InputStream resourceAsStream = Demo.class.getClassLoader().getResourceAsStream("a.txt");
        BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream));
        String redline;
        while ((redline=reader.readLine())!=null){
            String[] split = redline.split("-");
            FaultQue fault = new FaultQue();
            fault.setId(Integer.valueOf(split[0]));
            fault.setQueName(split[1]);
            fault.setSett(split[2]);
            fault.setFlag(false);
            System.out.println(fault);
        }
    }
}
